package com.chang.mapper;

import com.chang.entity.Essay;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Date;

public interface EssayMapper {
    //void add(Essay essay);
    //查询所有的推文信息
    List<Essay> findAllEssay();
    List<Essay> findAllEssays();

    //查询每条推文的详细信息
    Essay findEachEssay(@Param("essayId") int essayId);
    String findEssayTitle(@Param("essayId") int essayId);
    Essay checkEssayByName(@Param("title")String title);

    Essay findEssayById(@Param("id")int id);

    Essay checkEssay(@Param("title")String title, @Param("author")String author,
                     @Param("content")String content, @Param("time") Date time, @Param("type")String type);

    int insertEssay(@Param("title")String title, @Param("author")String author,
                    @Param("content")String content, @Param("time") Date time, @Param("type")String type);

    int updateEssay(@Param("id")int id,@Param("title")String title,@Param("author")String author,
                    @Param("content")String content, @Param("time")Date time, @Param("type")String type);

    boolean deleteEssay(@Param("id")int id);


}




